<%--
  Created by IntelliJ IDEA.
  User: cc
  Date: 2017/6/7
  Time: 上午11:12
  To change this template use File | Settings | File Templates.
--%>
<%@page import="com.cc.pojo.Student"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>更新图书信息</title>

    <script type="text/javascript">
        function check(form) {
            with (form) {
                if (name.value == "") {
                    alert("姓名不能为空");
                    return false;
                }
                if (id.value == "") {
                    alert("ID不能为空");
                    return false;
                }

                if (age.value == "") {
                    alert("姓名不能为空");
                    return false;
                }

                if (sex.value == "") {
                    alert("性别不能为空");
                    return false;
                }

            }
        }
    </script>

</head>


<body>
<%
    // 获取图书信息集合
    Student student = (Student)request.getAttribute("student");
%>
<form action="updateStudent" method="post" onsubmit="check(this)">
    <table align="center" width="450">
        <tr>
            <td align="center" colspan="2">
                <h2>更新学生信息</h2>
                <hr>
            </td>
        </tr>

        <tr>
            <td align="right">ID：</td>
            <td><input type="text" name="id" value="<%=student.getId()%>"></td>
        </tr>
        <tr>
            <td align="right">姓 名：</td>
            <td><input type="text" name="name" value="<%=student.getName()%>"></td>
        </tr>

        <tr>
            <td align="right">年 龄：</td>
            <td><input type="text" name="age" value="<%=student.getAge()%>"></td>
        </tr>

        <tr>
            <td align="right">性别：</td>
            <td><input type="text" name="sex" value="<%=student.getSex()%>"/></td>
        </tr>

        <tr>
            <td align="right">电 话：</td>
            <td><input type="text" name="phoneNumber" value="<%=student.getPhoneNumber()%>"/></td>
        </tr>
        <tr>
            <td align="center" colspan="2"><input type="submit" value="Update">
            </td>
        </tr>
    </table>
</form>

<h2 align="center">
    <a href="studentList">查询学生信息</a>
</h2>

</body>
</html>
